﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RefAndOut
{
    class Program
    {
        static bool Check(String name, String num,ref string info)
        {
            if(name == "admin")
            {
                //名字正确
                if (num == "8888")
                {
                    //密码正确
                    info = "登陆成功";
                }
                else
                {
                    info = "密码错误";
                    return false;
                }

            }
            else
            {
                info = "用户名错误";
                return false;
            }
            return true;
        }
        static void Main(string[] args)
        {
            Console.WriteLine("输入用户名：");
            string name = Console.ReadLine();
            Console.WriteLine("输入密码：");
            string password = Console.ReadLine();
            string info = "";

            while (!Check(name, password, ref info))
            {
                Console.WriteLine(info);
                Console.WriteLine("输入用户名：");
                name = Console.ReadLine();
                Console.WriteLine("输入密码：");
                password = Console.ReadLine();
            }
            Console.WriteLine(info);
        }
    }
}
